import React  from 'react'
import style from './index.less'


const NumberWithColor=({text})=>{
  const value = Number(text.replace('%',''))
  let classname
  if(value>0&&value<100){
    classname='plus'
  }else if(value<0&&value>-100){
    classname='minus'
  }else{
    classname=null
  }
  return (
  <div className={style.root}>
    <em className={classname}>{text}</em>
  </div>
)
}

NumberWithColor.propTypes={
  // x:React.PropTypes.object.isRequired,
  // y:React.PropTypes.object.isRequired,
  // data:React.PropTypes.array.isRequired
}

export default NumberWithColor
